package GroupChats;



import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class Server {
    public static List<Socket> socketList = new ArrayList<>();
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(8888);

        while (true) {
            Socket socket = serverSocket.accept();
            Thread thread = new MyThread1(socket);
            thread.start();
            socketList.add(socket);
            System.out.println(socket.getRemoteSocketAddress() + " 已上线了!!!");

        }


    }
}
